(function(root,factory,plugin){
           factory(root.jQuery,plugin);
		})(window,function($,plugin){
			__DEFAULT__={
                url:'../../../assets/js/versionInfoData.js',
                type:'get',
                dataType:'json',
                sidebarBgColor:'#abcdef'
			};
			__PROTOTYPE__={
				_init:function(){
                    var containerHtml="<div class=\"container\">"+
			            "<div class=\"main\">"+
	                        "<div class=\"app-item app-item-template\">"+
							    "<div class=\"app-item-title\">更新</div>"+
								"<div class=\"app-item-content\">"+
								"</div>"+
							"</div>"+
			            "</div>"+
			            "<div class=\"clean\">"+
			            "</div>"+
                    "</div>";
                    this.append(containerHtml);
                    this.$main=$(".main");
					/*this.$sidebar=$(".sidebar");*/
					this.$body=$("body");
					/*this.$sidebar.css("background-color",this.sidebarBgColor);*/
                    this._load();
				},
				_load:function(){
					var _this=this;
					$.ajax({
						url:_this.url,
						type:_this.type,
						dataType:_this.dataType,
						success:function(data){
                           var result=data;
                            /*_this.$sidebar.find(".app-name").text(result.brief.name).end().find("img").attr("src",result.brief.img).end().find(".app-time .span-content").text(result.brief.time);*/
                            if(result.details.length){
                                for(var i=0;i<result.details.length;i++){
                                    var $template=$(".app-item-template").clone().removeClass("app-item-template");
                                    $template.find(".app-item-title").text(result.details[i].title).next(".app-item-content").html(result.details[i].content);
                                    _this.$main.append($template);
                                }
                            }else{
                            	_this.$main.html("暂时没有更新记录");
                            }
                            $(".app-item:last-child").css("border-bottom","0px");
                          /* _this._adjust();*/
						},
						error:function(a,b,c){
							console.log(b);
						}
					});
				},
				_adjust:function(){
					this.mainH=this.$main.outerHeight(true);
					this.sidebarH=this.$sidebar.outerHeight(true);
					this.bodyW=this.$body.outerWidth(true);
					this.sidebarW=this.$sidebar.outerWidth(true);
					if(this.mainH>this.sidebarH){
		                this.$sidebar.css("height",this.mainH);
		            }else{
		            	this.$main.css("height",this.sidebarH);
		            }
		            this.mainW=this.bodyW-(this.sidebarW+1)-40;
		            this.$main.css("width",this.mainW);
				}
			};
            $.fn[plugin]=function(options){
                $.extend(this,__PROTOTYPE__,__DEFAULT__,options);
                this._init();
            }
		},"versionTip");